package com.example.wordapp.mapper;

import com.example.wordapp.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from user where id = #{id}")
    User findUser(String id);

    @Select("select id, name, create_time, update_time from user")
    List<User> findAll();

    @Select("select id, name, code, create_time, update_time from user where id = #{id} and code = #{code}")
    User login(Integer id, String code);
}
